<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="/includes/jsp/titulo.jsp"></jsp:include>
<form action="salvaDepartamento" method="POST">
  <input type="hidden" name="id"  value="${param.id}">
  <input type="hidden" name="codigo" id="codigo" value="${departamento.depcodigo}">
  <table>
  <tr>
    <td>Nome:</td>
    <td><input type="text" name="nome" size="30" value="${departamento.depnome}"></td>
  </tr>
  <tr>
    <td>Sigla:</td>
    <td><input type="text" name="sigla" size="5" value="${departamento.depsigla}"></td>
  </tr>
  <tr>
    <td>Saldo Conta:</td>
    <td><input type="text" name="saldoconta" size="12" value="${departamento.depsaldoconta}"></td>
  </tr>
  <tr>
    <td>Dept. Superior:</td>
    <td><select size="1" name="depdepcodigo">
           	<option value=0> </option>
           	<c:forEach var="departamentos" items="${departamentos}" varStatus="s" >
           		<option value=${departamentos.depcodigo} 
                   <c:if test="${departamento.depdepcodigo==departamentos.depcodigo}">
                      selected
                   </c:if>  
                   > ${departamentos.depnome}</option>     
            </c:forEach>           	
       	</select>
    </td>    
  </tr>
  <c:if test="${departamento.depativo or empty departamento.depcodigo}">
  	<input type="hidden" name="ativo"  value="true">
  </c:if>
  <tr>
    <td colspan="2">
      <input type="submit" name="salvar" value="Salvar">
      <input type="button" name="cancelar" value="Cancelar" onclick="history.back();">
      <c:if test="${!empty departamento.depcodigo}">
        <input type="submit" name="remover" value="Remover">
      </c:if>
      </td>
  </tr>
</table>
</form>
